package ctrLayer;

import com.jaunt.Element;
import com.jaunt.JauntException;
import com.jaunt.UserAgent;

public class Scraper {
	
	public static void main(String[] args){
		new Scraper();
	}
	
	public Scraper() {
		scrape("http://www.biltorvet.dk/MinBil/Opslag/fa21432");
	}
	
	public void scrape(String url){
		try{
			UserAgent userAgent = new UserAgent();
			
			userAgent.visit(url);
			//System.out.println(userAgent.doc.innerHTML());
			
			Element body = userAgent.doc.findFirst("<body>");
			Element div = body.findFirst("<div id=\"contentArea\">");
			//String div = userAgent.doc.findFirst("Registreringsnummer:").getText();
			System.out.println(div.innerText());
			
		}catch(JauntException e){
			System.out.println(e.getMessage());
		}
	}
	
}
